import { createBrowserRouter } from 'react-router';
import Layout from '../components/Layout';
import HomePage from '../views/HomePage';
import PatternDetailPage from '../views/PatternDetailPage';

// 创建路由配置
export const createAppRouter = () => {
  return createBrowserRouter([
    {
      path: "/",
      Component: Layout,
      children: [
        {
          index: true,
          Component: HomePage
        },
        {
          path: "pattern/:id",
          Component: PatternDetailPage
        }
      ]
    }
  ]);
};
